package com.hitqz.robot.driver.util;


import java.util.HashMap;
import java.util.Map;
/**
 * 鲁渝能源无线充电机
 */
public enum LynyErrorCodeEnum {

    OUTPUT_OVER_CURRENT_PROTECTION((byte) 0x02, "输出过流保护"),

    OUTPUT_UNDER_CURRENT_PROTECTION((byte) 0x03, "输出欠流保护"),

    VRECT_OVER_VOLTAGE_PROTECTION((byte) 0x04, "Vrect过压保护"),

    VRECT_UNDER_VOLTAGE_PROTECTION((byte) 0x05, "Vrect欠压保护"),

    OUTPUT_OVER_VOLTAGE_SOFTWARE_PROTECTION((byte) 0x06, "输出过压软件保护"),

    OVER_TEMPERATURE_PROTECTION((byte) 0x08, "过温保护"),

    FULL_CHARGE_PROTECTION((byte) 0x09, "满充保护"),

    SHUTDOWN_FLAG((byte) 0x0B, "关机标志"),

    OVER_TEMPERATURE_NO_START_PROTECTION((byte) 0x0D, "过温不启动保护"),

    OUTPUT_OVER_VOLTAGE_HARDWARE_PROTECTION((byte) 0x0E, "输出过压硬件保护"),

    SHORT_CIRCUIT_PROTECTION((byte) 0x0F, "短路保护"),

    VRECT_STABILIZATION_TIMEOUT_PROTECTION((byte) 0x10, "Vrect稳压超时保护"),

    IN_PROGRESS_FOD_PROTECTION((byte) 0x11, "事中FOD保护"),

    MULTIPLE_DEVICES_AUTO_PAIRING_PROTECTION((byte) 0x12, "多台设备开启自动配对保护"),

    LONG_DISTANCE_PROTECTION((byte) 0x13, "远距离保护")


    ;

    public final static Map<Byte, LynyErrorCodeEnum> codeMap = new HashMap<>(20);

    //这个enum的code的映射map
    static {
        for (LynyErrorCodeEnum e : LynyErrorCodeEnum.values()) {
            codeMap.put(e.code, e);
        }
    }



    private final byte code;
    private final String desc;

    LynyErrorCodeEnum(byte code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public byte getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


}
